package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.SkuHasStockTo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author huyulu
 * @email 1085068942@qq.com
 * @date 2021-11-28 23:13:17
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPageByCondition(Map<String, Object> params);

    /**
     * 添加库存
     *
     * @param skuId  添加的商品ID
     * @param wareId 放入的仓库
     * @param skuNum 放入的数量
     * @author 胡菜鸡
     * @date 2021/12/28 16:25
     */
    boolean addStock(Long skuId, Long wareId, Integer skuNum);

    /**
     * 根据id查询传递过来的所有sku是否有库存
     *
     * @param skuIds 传递来的所有skuId集合
     * @author 胡菜鸡
     * @date 2021/12/31 14:11
     */
    List<SkuHasStockTo> getSkusHasStock(List<Long> skuIds);
}

